import request from '@/plugins/axios'


export function query(query){
    return request({
        url: '/api/building/page',
        method: 'get',
        params: query
    })
}

export function save(data){
    return request.post('/api/building', data)
}

export function remove(ids){
    return request({
        url: '/api/building/delete',
        method: 'post',
        data: ids
    })
}
export function validateProjectCode(param){
    return request({
        url: '/api/building/validateProjectCode',
        method: 'get',
        params: param
    })
}

export function get(buildingId){
    return request({
        url: '/api/building/' + buildingId,
        method: 'get'
    })
}

export function getBuildAddress(buildingId){
    return request({
        url: '/api/building/getBuildAddress/' + buildingId,
        method: 'get'
    })
}


export function update(data){
    return request({
        url: '/api/building',
        method: 'put',
        data: data
    })
}

export function getLandInfo(type,id){
    return request({
        url: '/api/landinfo/getByProjectId/'+ type + '/' + id,
        method: 'get'
    })
}

export function configureQuery(query){
    return request({
        url: '/api/building/pageFacility',
        method: 'get',
        params: query
    })
}
//验证项目下是否还能新增楼栋
export function validateProjectBuildNum(projectId, buildingId){
    return request({
        url: '/api/building/validateProjectBuildNum',
        method: 'get',
        params: {'projectId': projectId,'buildingId': buildingId}
    })
}
